import request from "@/utils/request";

// 查询学科信息列表
export const getsubjectListApi = (params) =>
  request({
    method: "get",
    url: "/subject/subject",
    params,
  });

// 查询学科信息详情
export const getsubjectApi = (id) =>
  request({
    method: "get",
    url: "/subject/subject/" + id,
  });

// 增加学科信息
export const addsubjectApi = (data) =>
  request({
    method: "post",
    url: "/subject/subject",
    data,
  });
// 修改学科信息
export const editsubjectApi = (data) =>
  request({
    method: "put",
    url: "/subject/subject/" + data.id,
    data,
  });
// 删除学科信息
export const delsubjectApi = (id) =>
  request({
    method: "DELETE",
    url: "/subject/subject/" + id,
  });

// 上传图片
export const uploadImage = (data) =>
  request({
    url: "/index/upload?mode=single&type=image",
    method: "post",
    data: data,
  });
